<?php
/* @var $this DisplayController */

$this->breadcrumbs=array(
    yii::t('other/Site','Courses')=>array('display/courseList'),
    $model->course_name,
);
?>
    <div style="width:75%;float:left;background:white;">
        <div class="panel panel-box" style="overflow:hidden;">
            <div class="panel-heading">
                <h3 class="panel-title">
                <?php $params = array(
                            'teacher'=>User::model()->findByPk(yii::app()->user->id),
                            'course'=> $model->course_id
                        );?>
                <?php if(yii::app()->user->checkAccess('admin')||yii::app()->user->checkAccess('teacher',$params)):?>
                <span id="updateCourseBrief" class="pull-right glyphicon glyphicon-pencil"
                    data-toggle="modal" data-target="#courseBriefModal" style="cursor:pointer"></span>
                <?php endif;?>
                    <?php echo yii::t('other/Site','Course Brief');?>
                </h3>
            </div>
            <div class="panel-body" style="padding:15px">
                <?php echo $model->brief;?>
            </div>
        </div>
        <div class="panel panel-box" style="overflow:hidden;">
            <div class="panel-heading">
                <h3 class="panel-title">
                <?php $params = array(
                            'teacher'=>User::model()->findByPk(yii::app()->user->id),
                            'course'=> $model->course_id
                        );?>
                <?php if(yii::app()->user->checkAccess('admin')||yii::app()->user->checkAccess('teacher',$params)):?>
                <span id="updateCourseContent" class="pull-right glyphicon glyphicon-pencil"
                    data-toggle="modal" data-target="#couseContentModal" style="cursor:pointer"></span>
                <?php endif;?>
                    <?php echo yii::t('other/Site','Course Content');?>
                </h3>
            </div>
            <div class="panel-body" style="padding:15px">
                <?php echo $model->description;?>
            </div>
        </div>
</div>
    <div style="width:24%;float:right;background:white;">
       <div class="panel panel-box" style="text-overflow:ellipsis;">
            <div class="panel-heading">
                <h3 class="panel-title">
                <?php $params = array(
                            'teacher'=>User::model()->findByPk(yii::app()->user->id),
                            'course'=> $model->course_id
                        );?>
                <?php if(yii::app()->user->checkAccess('admin')||yii::app()->user->checkAccess('teacher',$params)):?>
                <span id="updateTeacherInfo" class="pull-right glyphicon glyphicon-pencil"
                    data-toggle="modal" data-target="#teacherInfoModal" style="cursor:pointer"></span>
                <?php endif;?>
                <?php echo yii::t('other/Site','Teacher Brief');?>
                </h3>
            </div>
            <div class="panel-body" style="padding:15px">
                <?php echo $model->teacher_info;?>
            </div>
   </div>
    <?php $this->widget('CourseResourcesBox',array('courseModel'=>$model));?>
</div>

<!--teacher brief modal -->
<div class="modal fade" id="teacherInfoModal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true">
  <div class="modal-dialog" style="width:70%;margin-top:4%">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="mymodallabel"><?php echo yii::t('other/Site','Teacher Brief');?></h4>
      </div>
      <div class="modal-body">
        <form method="post" action="">
            <div class="form-group">
                <textarea id="inputTeacherInfo" name="TeacherInfo">
                    <?php echo $model->teacher_info;?>
                </textarea>
     	    <script type="text/javascript">
            var editor = new UE.ui.Editor({
                toolbars:[['source', '|', 'undo', 'redo', '|', 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', '|',
                    'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                    'insertimage', 'emotion','date', 'time','inserttable','|',
                    'fontfamily', 'fontsize', '|', 'spechars'
                    ]]
            });
			    editor.render("inputTeacherInfo");
            </script>
            </div>
            <div class="text-right">
                <button type="submit" class="btn btn-primary">
                    <?php echo yii::t('other/Site','Save');?>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">
                    <?php echo yii::t('other/Site','Close');?>
                </button>
            </div>
        </form>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!--course brief modal -->
<div class="modal fade" id="courseBriefModal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true">
  <div class="modal-dialog" style="width:70%;margin-top:4%">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="mymodallabel"><?php echo yii::t('other/Site','Course Brief');?></h4>
      </div>
      <div class="modal-body">
        <form method="post" action="">
            <div class="form-group">
                <textarea id="inputCourseBrief" name="courseBrief">
                    <?php echo $model->brief;?>
                </textarea>
     	    <script type="text/javascript">
            var editor = new UE.ui.Editor({
                toolbars:[
                    ['source', '|', 'undo', 'redo', '|',
                    'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                    'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                    'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                    'directionalityltr', 'directionalityrtl', 'indent', '|',
                    'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
                    'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
                    'insertimage', 'emotion', 'scrawl', 'insertvideo', 'insertcode','template', 'background', '|',
                    'horizontal', 'date', 'time', 'spechars','wordimage', '|',
                    'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', '|',
                    'print', 'preview', 'searchreplace', 'help']
                ]
            });
			    editor.render("inputCourseBrief");
            </script>
            </div>
            <div class="text-right">
                <button type="submit" class="btn btn-primary">
                    <?php echo yii::t('other/Site','Save');?>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">
                    <?php echo yii::t('other/Site','Close');?>
                </button>
            </div>
        </form>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!--course content modal -->
<div class="modal fade" id="couseContentModal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true">
  <div class="modal-dialog" style="width:70%;margin-top:4%">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="mymodallabel"><?php echo yii::t('other/Site','Course Content');?></h4>
      </div>
      <div class="modal-body">
        <form method="post" action="">
            <div class="form-group">
                <textarea id="inputCourseContent" name="courseContent">
                    <?php echo $model->description;?>
                </textarea>
     	    <script type="text/javascript">
            var editor = new UE.ui.Editor({
                toolbars:[
                    ['source', '|', 'undo', 'redo', '|',
                    'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                    'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                    'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                    'directionalityltr', 'directionalityrtl', 'indent', '|',
                    'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
                    'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
                    'insertimage', 'emotion', 'scrawl', 'insertvideo', 'insertcode','template', 'background', '|',
                    'horizontal', 'date', 'time', 'spechars','wordimage', '|',
                    'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', '|',
                    'print', 'preview', 'searchreplace', 'help']
                ]
            });
			    editor.render("inputCourseContent");
            </script>
            </div>
            <div class="text-right">
                <button type="submit" class="btn btn-primary">
                    <?php echo yii::t('other/Site','Save');?>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">
                    <?php echo yii::t('other/Site','Close');?>
                </button>
            </div>
        </form>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->


